#ifndef __UDP_H__
#define __UDP_H__
#include <Windows.h>
#include <string>
#include <iostream>

#define OP_ERROR -1
#define OP_SUCCESS 0
#define MAX_BUF_LEN 2048

int Udp_Create(int port);
void Udp_OnReceive(int fd, int ptr);
bool Udp_SendToServer(int fd, char *remoteip, int remoteport, char *bufer, int len);
bool Udp_SendToClient(int fd, char *localip, int localport,
					  char *remoteip, int remoteport, char *bufer, int len);
void UdpPackParseEx(int fd, char *laddr, int lport, char *buffer, int len,
					char *raddr, int rport);
std::string HP_GetIPAddress(char *url);
extern void (*_func_ConsumerUdp_SendToServer)(int fd, char *laddr, int lport, char *buffer, int len);
extern void (*_func_ConsumerUdp_SendToClient)(int fd, char *localip, int localport,
											  char *remoteip, int remoteport, char *bufer, int len);
#endif
